<!DOCTYPE html>

<html class="no-js">

<head>
  <meta charset="utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <title></title>
  <meta name="description" content="" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <script src="https://cdn.staticfile.org/axios/0.19.0-beta.1/axios.js"></script>
  <script src="https://cdn.staticfile.org/vue/2.5.17/vue.js"></script>
  <link rel="stylesheet" href="https://cdn.staticfile.org/element-ui/2.13.0/theme-chalk/index.css" />
  <script src="https://cdn.staticfile.org/element-ui/2.13.0/index.js"></script>
  <link rel="stylesheet" href="https://cdn.staticfile.org/animate.css/3.7.0/animate.min.css" />
  <link rel="stylesheet" href="../../lib/index.css" />
  <script src="../../lib/avue.js"></script>
</head>

<body>
  <div id="app">
    <avue-form :option="option" v-model="data"></avue-form>
  </div>
</body>
<script>
  new Vue({
    el: '#app',
    data() {
      return {
        data: {},
        option: {
          page: false,
          border: true,
          index: true,
          align: 'center',
          labelWidth: 100,
          menuAlign: 'center',
          dialogClickModal: false,
          column: [
            {
              label: 'prop字段',
              prop: 'prop',
              rules: [{
                required: true,
                message: '请输入查询字段',
                trigger: 'blur'
              }]
            }, {
              label: "补贴类型",
              prop: "subsidyType",
              align: "center",
              type: "tree",
              span: 12,
              multiple: true,
              parent: false,
              search: true,
              hide: true,
              dicData: [{ "label": "独居老人", "value": "1" }, { "label": "90岁及以上老人", "value": "2" }, { "label": "残疾老人", "value": "3" }],
            }, {
              label: '显示标题',
              prop: 'label',
              rules: [{
                required: true,
                message: '请输入显示标题',
                trigger: 'blur'
              }]
            },
            {
              label: '表单类型',
              prop: 'formType',
              type: 'select',
              clearable: false
            },
            {
              label: '序号',
              prop: 'sort',
              type: 'number',
              minRows: 1
            }, {
              label: '辅助文字',
              prop: 'searchPlaceholder'
            },
            {
              label: '运算类型',
              prop: 'operType',
              type: 'select',
              hide: true,
              rules: [{
                required: true,
                message: '请选择运算类型',
                trigger: 'blur'
              }]
            },
            {
              label: '数据类型',
              prop: 'dataType',
              type: 'select',
              hide: true,
              rules: [{
                required: false,
                message: '请选择数据类型',
                trigger: 'blur'
              }]
            },
            {
              label: '选择字典',
              prop: 'dictionary',
              type: 'tree',
              hide: true,
              visdiplay: false,
            }, {
              label: '数据源',
              prop: 'dataSource',
              type: 'textarea',
              placeholder: '数据类型为SQL，则填写SQL脚本；类型为URL，则填写url地址',
              span: 24,
              hide: true,
              visdiplay: false,
              rules: [{
                required: false,
                message: '请输入',
                trigger: 'blur'
              }]
            }
          ]
        }
      };
    }
    ,
    mounted() {
      setTimeout(() => {
        this.option.column[6].rules[0].required = true
      }, 2000)
    }
  })
</script>

</html>